package edu.kpi.pzks2.queue;

import java.util.Comparator;
import java.util.List;

import edu.kpi.pzks2.graph.Edge;
import edu.kpi.pzks2.graph.Node;
import edu.kpi.pzks2.simulator.core.QueueBuilder;
import edu.uci.ics.jung.graph.Graph;

public class QueueBuilder2 extends BaseQueueBuilder implements QueueBuilder {
    public static final String NAME = "QUEUE2";
    
    public List<Node> buildQueue(Graph<Node, Edge> graph) {
        return super.buildQueue(graph, new Comparator<NodeStatistDescriptor>() {
            public int compare(NodeStatistDescriptor o1, NodeStatistDescriptor o2) {
                return o2.getCriticalPathLength() - o1.getCriticalPathLength();
            }
        });
    }

}
